<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<jsp:include page="../../../inc/xheditor.jsp"></jsp:include>
<script type="text/javascript">
	$(document).ready(function() {
		$("#msgReply").load("msgReplyList.do", {
			tableName : '${param.tableName }',
			pid : '${param.pid }',
			id : '${param.id}',
			random : Math.random()
		});
		$("#msgReply_submit").button().click(function() {
			var hidden = "N";
			if ($("#hidden").attr("checked"))
				hidden = "Y";
			var content = $("#content").val();
			
			if (content == '') {
				alert('请输入留言内容！');
				return false;
			}
			var code = $("#code").val();
			if (code == '') {
				alert('请输入验证码！');
				return false;
			}
			$.get("addMsgReply.do", {
				id : $("#id").val(),
				pid : $("#pid").val(),
				tableName : $("#tableName").val(),
				content : $("#content").val(),
				hidden : hidden,
				hiddenName : $("#hiddenName").val(),
				code : $("#code").val()
			}, function(data) {
				alert(data);
			});
		});
	});
</script>
<div class="msgReply">
	
	<fieldset style="width: 99%; margin: auto auto">
		<legend>
			我要留言
		</legend>
		<div id="msgReply"></div>
		<input type="hidden" id="tableName" value="${param.tableName }">
		<input type="hidden" id="pid" value="${param.pid }">
		<!-- <div><label>标题：</label><input type="text" name="title" style="width:490px;"></div> -->
		<div>
			<textarea cols="10" rows="5" style="width: 590px; height: 200px"
				class="xheditor-mini" id="content" name="content"></textarea>
		</div>
		<div style="padding:3px;">
			匿名
			<input type="checkbox" name="hidden" id="hidden" />
			<input type="text" name="hiddenName" id="hiddenName" value="">
			输入验证码
			<input type="text" name="code" id="code" style="width: 30px;">
			<img style="margin: 0; border: 0; cursor: hand" title="点击切换图片"
				align="top" src="getCodeImg" onClick="codeImg(this);" />
			<button id="msgReply_submit" style="float:right;">
				发布留言
			</button>
		</div>
	</fieldset>
</div>